package musicchange;

import java.io.File;

import main.FileOperations;
import main.FinishWindow;
import exceptions.NotDirException;

public class Unpack {
	File dir;

	public Unpack(String path) {
		try {
			dir = FileOperations.checkDir(path);
			boolean end = unpacking();
			System.out.println("State of unpacking: " + end);
			if(end){
				FinishWindow.main(null);
			}
		} catch (NotDirException e) {
			System.out.println(e.getStackTrace());
		}
	}

	private boolean unpacking() {
		FileOperations.unpackFromDirs(dir);
		return true;
	}

}
